package org.dao.imp;

import java.util.List;

import org.dao.KcDao;
import org.model.Kcb;
import org.model.Xsb;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

public class KcDaoImp extends HibernateDaoSupport implements KcDao {

	@Override
	public Kcb getOneKc(String kch) {
		List list = getHibernateTemplate().find("from Kcb where kch=?",kch);
		if(list.size()>0)
			return  (Kcb) list.get(0);
		else
			return null;
	}

	@Override
	public List getAll() {
		List list= getHibernateTemplate().find("from Kcb order by kch");
		return list;
	}

}
